function toggle_display(cmd)
% toggle_display - change display from data list to data traces
h1=findobj('Tag', 'DataFrame'); % actually, when this is visible, we see the list.
h2=findobj('Tag', 'ToggleButton');
h3=findobj('Tag', 'CTL');
k = 1;
data_h = [];
for i = 1:4
   n1 = sprintf('datawin%1d_info', i-1);
   n2 = sprintf('data_text%1d', i-1);
   hn1 = findobj('tag', n1);
   if(~isempty(hn1) & ishandle(hn1))
      data_h(k) = hn1;
   k = k + 1;
end;
	hn2 = findobj('tag', n2);
   if(~isempty(hn2) & ishandle(hn2))
      data_h(k) = hn2;
      k = k + 1;
   end;
end;
hn3 = findobj('tag', 'datac_storecursor');
   if(~isempty(hn3) & ishandle(hn3))
      data_h(k) = hn3;
      k = k + 1;
   end;

list_h = findobj('tag', 'CTL');

switch(lower(cmd))
case 'toggle'
    u = get(h1, 'Visible');
   if(strcmp(lower(u),'Off'))
      set(h1, 'Visible', 'On');
      set(h2, 'String', 'Show Data');
   else
      set(h1, 'Visible', 'Off');
      set(h2, 'String', 'Show List');
   end
   u = get(h3, 'Visible');
   if(strcmp(lower(u),'off'))
      set(list_h, 'Visible', 'On');
      set(data_h, 'Visible', 'Off');
   else 
      set(list_h, 'Visible', 'Off');
      set(data_h, 'Visible', 'On');
   end
case 'list'
   set(data_h, 'Visible', 'Off');
   set(h2, 'String', 'Show Data');
   set(list_h, 'Visible', 'On');
    return;
case 'data'
   set(list_h, 'Visible', 'Off');
   set(h2, 'String', 'Show List');
   set(data_h, 'Visible', 'On');
   set(h1, 'Visible', 'Off');
   return;
   
otherwise
end
return;
